import React, { Component } from 'react';
import moment from 'moment';  //time格式工厂
import style from './detailsStyle.less'
import { connect } from 'dva';
import { FormattedMessage, formatMessage } from 'umi/locale'; //此方法引入的数据可以在src/locales中配置
import {
  Button,
  Input,
  DatePicker,
  Form,
  Row,
  Col,
  Table,
  Modal,
  Select,
  Card,
  PageHeader,
  Alert,
  Pagination,
  Upload,
  message,
  Icon,
} from 'antd';

class DetailsModel extends React.Component {
    constructor (props){
        super(props);

    }

    render(){

        return (

            <div>
                <Modal
                visible={this.props.datailsState}
                title={formatMessage({ id: 'iot.organization.dept_nickname'})+"信息"}
                onCancel={this.props.closeDatails}
                nowData={this.props.nowData}
                destroyOnClose={true}
                maskClosable={false}
                bodyStyle={{
                    width: 800,
                }}
                width='800px'
                footer={[
                    <Button
                    key="submit"
                    type="primary"
                    onClick={this.props.closeDatails}
                    >
                    确定
                    </Button>,
                ]}>
                {/* 行1 */}
                <div className={style['one-line']}>
                    <div className={style['one-block']}>
                        <p className={style.p1}>{formatMessage({ id: 'iot.organization.details_modal_box.dept_name'})}：</p>
                        <p className={style.p2}>{this.props.nowData?this.props.nowData.dept_name:undefined}</p>
                    </div>
                    <div className={style['one-block']}>
                        <p className={style.p1}>{formatMessage({ id: 'iot.organization.details_modal_box.dept_abbr'})}：</p>
                        <p className={style.p2}>{this.props.nowData?this.props.nowData.dept_abbr:undefined}</p>
                    </div>

                </div>
                {/* 行2 */}
                <div className={style['one-line']}>
                    <div className={style['one-block']}>
                        <p className={style.p1}>{formatMessage({ id: 'iot.organization.details_modal_box.create_time'})}：</p>
                        <p className={style.p2}>{this.props.nowData?this.props.nowData.create_time:undefined}</p>
                    </div>
                    <div className={style['one-block']}>
                        <p className={style.p1}>{formatMessage({ id: 'iot.organization.details_modal_box.create_user_name'})}：</p>
                        <p className={style.p2}>{this.props.nowData?this.props.nowData.create_user_name:undefined}</p>
                    </div>
                </div>
                  <div className={style['one-line']}>
                    <div className={style['one-block']}>
                      <p className={style.p1}>{formatMessage({ id: 'iot.organization.modal_box.person'})}：</p>
                      <p className={style.p2}>{this.props.nowData?this.props.nowData.legal_person:undefined}</p>
                    </div>
                    <div className={style['one-block']}>
                      <p className={style.p1}>{formatMessage({ id: 'iot.organization.modal_box.status'})}：</p>
                      <p className={style.p2}>{this.props.nowData?this.props.nowData.company_state:undefined}</p>
                    </div>
                  </div>
                {/* 行3 */}
                <div className={style['one-line']}>
                    <div className={style['one-block']}>
                        <p className={style.p1}>{formatMessage({ id: 'iot.organization.details_modal_box.dept_id'})}：</p>
                        <p className={style.p2}>{this.props.nowData?this.props.nowData.dept_id:undefined}</p>
                    </div>
                  </div>
                </Modal>
            </div>
        )

    }
}

export default DetailsModel;
